﻿@model RGA.Models.ViewModels.EditRouteViewModel

@{
    ViewBag.Title = "EditRoute";
}

<h2>EditRoute</h2>

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()

    <div class="form-horizontal">
        <h4>Route</h4>
        <hr />
        @Html.ValidationSummary(true, "", new {@class = "text-danger"})
        @Html.HiddenFor(model => model.Id)
        @Html.HiddenFor(model => model.WorkerId)




        <div class="form-group">
            @Html.LabelFor(model => model.Description, new {@class = "control-label col-md-2"})
            <div class="col-md-10">
                @Html.EditorFor(model => model.Description, new {htmlAttributes = new {@class = "form-control"}})
                @Html.ValidationMessageFor(model => model.Description, "", new {@class = "text-danger"})
            </div>
        </div>


        <div class="form-group">
            @Html.LabelFor(model => model.StartDate, new {@class = "control-label col-md-2"})
            <div class="col-md-10">
                @Html.EditorFor(model => model.StartDate, new {htmlAttributes = new {@class = "form-control"}})
                @Html.ValidationMessageFor(model => model.StartDate, "", new {@class = "text-danger"})
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.StartAddress, new {@class = "control-label col-md-2"})
            <div class="col-md-10">
                @Html.EditorFor(model => model.StartAddress, new {htmlAttributes = new {@class = "form-control"}})
                @Html.ValidationMessageFor(model => model.StartAddress, "", new {@class = "text-danger"})
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.EndAddress, new {@class = "control-label col-md-2"})
            <div class="col-md-10">
                @Html.EditorFor(model => model.EndAddress, new {htmlAttributes = new {@class = "form-control"}})
                @Html.ValidationMessageFor(model => model.EndAddress, "", new {@class = "text-danger"})
            </div>
        </div>



        <div class="form-group">
            @Html.LabelFor(model => model.State, new {@class = "control-label col-md-2"})
            <div class="col-md-10">
                @Html.EnumDropDownListFor(model => model.State, new {@class = "form-control"})
                @Html.ValidationMessageFor(model => model.State, "", new {@class = "text-danger"})
            </div>
        </div>
        
        <div class="form-group">
            @Html.LabelFor(model => model.AllowTollRoads, new {@class = "control-label col-md-2"})
            <div class="col-md-10">
                @Html.CheckBoxFor(model => model.AllowTollRoads, new {htmlAttributes = new {@class = "form-control"}})
                @Html.ValidationMessageFor(model => model.AllowTollRoads, "", new {@class = "text-danger"})
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.DistanceMatrixProvider, new {@class = "control-label col-md-2"})
            <div class="col-md-10">
                @Html.EnumDropDownListFor(model => model.DistanceMatrixProvider, new {@class = "form-control"})
                @Html.ValidationMessageFor(model => model.DistanceMatrixProvider, "", new {@class = "text-danger"})
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.RouteOptimizationAlgorithm, new {@class = "control-label col-md-2"})
            <div class="col-md-10">
                @Html.EnumDropDownListFor(model => model.RouteOptimizationAlgorithm, new {@class = "form-control"})
                @Html.ValidationMessageFor(model => model.RouteOptimizationAlgorithm, "", new {@class = "text-danger"})
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.RouteOptimizationProvider, new {@class = "control-label col-md-2"})
            <div class="col-md-10">
                @Html.EnumDropDownListFor(model => model.RouteOptimizationProvider, new {@class = "form-control"})
                @Html.ValidationMessageFor(model => model.RouteOptimizationProvider, "", new {@class = "text-danger"})
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.RouteOptimizationType, new {@class = "control-label col-md-2"})
            <div class="col-md-10">
                @Html.EnumDropDownListFor(model => model.RouteOptimizationType, new {@class = "form-control"})
                @Html.ValidationMessageFor(model => model.RouteOptimizationType, "", new {@class = "text-danger"})
            </div>
        </div>

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="Zapisz zmiany" class="btn btn-primary btn-lg" />
            </div>
        </div>
    </div>
}

@Html.ActionLink("Zapisz jako nową trasę", "SaveAsNewRoute", Model, new {@class = "btn btn-primary btn-lg"})

<div>
    @Html.ActionLink("Back to List", "Index")
</div>